function sMatrix = construct_graph(graph_nodes, graph_edges)
    tStart = tic;

    %allocate memory for graph
    CMatrix=zeros(length(graph_nodes),length(graph_nodes));

    %create connection matrix
    for i=1:length(graph_edges)
        CMatrix(graph_edges(i,1),graph_edges(i,2)) = 1; 
        CMatrix(graph_edges(i,2),graph_edges(i,1)) = 1;
    end
    sMatrix = sparse(CMatrix);
    clear CMatrix;
    tElapsedSMatrixBuilding = toc(tStart)
end

